<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script setup>
import { useRoute, useRouter } from 'vue-router';
import { ref, watch } from 'vue';
import { useTabsStore } from '@/store/tabs/index.js'

const route = useRoute()
const router = useRouter()
const whitePath = ['/login', '/home', '/']

watch(route, (to, from) => {

  if (whitePath.indexOf(to.path) == -1) {
    const tabs = {
      menuName: to.name,
      path: to.path
    }
    useTabsStore().addTabs(tabs)
  }
})


</script>

<style lang="scss" scoped></style>
